package com.xnyzc.lhy.resource.common.cp.penum;

import com.xnyzc.lhy.common.entity.PEnum;

/**
 * 银联对接错误码枚举
 *
 * @Author: haoyfa
 * @Date: 2019-11-13
 */
public enum CPErrorCode implements PEnum<Integer> {
    // 成功标志
    success(0, "success"),
    unKnow(1001, "未知错误"),
    cpResourceServiceError(1002, "本地银联服务调用失败"),

    noBank_SEND(2001,"获取不到openBank"),
    signError(2002,"验签失败"),
    decryptDataError(2002, "敏感信息解密发生错误");

    int value;
    String desc;

    CPErrorCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name();
    }

    @Override
    public String toChString() {
        return desc;
    }

    public String toMessage() {
        String errorMessage = this.value + "," + this.desc;
        return errorMessage;
    }
}
